package com.andy.nature.utils

import com.andy.base.AppHelper

/**
 * Author:Andy
 * Date:2023/4/6 11:31
 * Description:Utils
 */
object ScreenUtils {
    //获取屏幕高度
    private var screenHeight = 0
    fun getScreenHeight(): Int {
        if (screenHeight == 0) {
            val context = AppHelper.mContext
            screenHeight = context.resources.displayMetrics.heightPixels
        }
        return screenHeight
    }

    //获取屏幕宽度
    private var screenWidth = 0
    fun getScreenWidth(): Int {
        if (screenWidth == 0) {
            val context = AppHelper.mContext
            screenWidth = context.resources.displayMetrics.widthPixels
        }
        return screenWidth
    }
}